function [T_order, T] = dynamic_resid_tt(y, x, params, steady_state, T_order, T)
if T_order >= 0
    return
end
T_order = 0;
if size(T, 1) < 16
    T = [T; NaN(16 - size(T, 1), 1)];
end
T(1) = (params(4)-1)*params(8)*y(11)/y(15);
T(2) = y(12)^(1-y(20));
T(3) = (y(20)-1)^2;
T(4) = T(2)*log(y(12))/(y(20)-1)+(T(2)-1)/T(3);
T(5) = (params(4)-1)*y(11)/y(15);
T(6) = y(12)^(-y(20));
T(7) = y(22)^(1-y(30));
T(8) = (y(30)-1)^2;
T(9) = params(4)*params(8)*params(1)*(T(7)*log(y(22))/(y(30)-1)+(T(7)-1)/T(8));
T(10) = y(21)/y(13);
T(11) = y(22)^(-y(30));
T(12) = params(1)*T(11);
T(13) = y(3)^params(4);
T(14) = y(15)^(1-params(4));
T(15) = params(4)*y(3)^(params(4)-1);
T(16) = y(15)^(-params(4));
end
